<template>
    <div class="userinfo_container">
        <img class="avatar" src="../assets/avatar.jpg" alt="avatar" @click="onClickAvatar"/>
        <span class="user_name">{{ userInfoStore.account }}</span>
    </div>
</template>

<script setup>
    import { useUserInfoStore } from '@/stores';
    const userInfoStore = useUserInfoStore()
    const emit = defineEmits(['clickAvatar'])
    function onClickAvatar() {
        emit('clickAvatar')
    }
</script>

<style scoped>
    .userinfo_container {
        display: flex;
        flex-direction: column;
        width: 100%;
        align-items: center;
        margin-top: 10px;
        margin-bottom: 20px;
    }
    .avatar {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        object-fit: cover;
    }
    .user_name {
        margin-top: 8px;
        font-weight: bold;
        font-size: 18px;
    }
</style>